<%@ page language="java" contentType="text/html; charset=UTF-8" isErrorPage="true" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="pagePath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${pagePath}/page/static/css/reset.css">
<link rel="stylesheet" type="text/css" href="${pagePath}/page/static/css/main.css">
<title>校园二手交易网-购物车</title>
</head>
<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到 校园二手交易网！</div>
			<div class="fr">
				<div class="user_link fl">
					<c:if test="${!empty loguser}">
						欢迎您：<em style="color: red;">${loguser.username}</em>
						<span>|</span>
						<a href="${pagePath}/logout.do">退出</a>
					</c:if>
				</div>
				<div class="login_btn fl">
					<c:if test="${empty loguser}">
						<a href="${pagePath}/login.do">登录</a>
						<span>|</span>
						<a href="${pagePath}/register.do">注册</a>
					</c:if>
				</div>
			</div>
		</div>
	</div>
	<div class="search_bar clearfix">
		<a href="${pagePath}/index.do" class="logo fl"><img src="${pagePath}/page/static/images/logo.png"></a>
		<div class="sub_page_name fl">&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;购物车</div>
		<div class="search_con fr">
			<form action="${pagePath}/goods.do">
				<input type="text" class="input_text fl" id="key" name="key" placeholder="搜索商品" required="required"> <input type="submit" class="input_btn fr" value="搜索">
			</form>
		</div>
	</div>
	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">购物车</h1>
			<ul class="navlist fl">
				<li><a href="${pagePath}/index.do" class="active">商品区</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/index_task.do">任务区</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/personal_info.do">个人中心</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/cart.do">购物车</a></li>
			</ul>
		</div>
	</div>
	<div class="total_count">
		全部商品<em>${totalCount}</em>件
	</div>
	<ul class="cart_list_th clearfix">
		<li class="col01">商品名称</li>
		<li class="col02"></li>
		<li class="col03"></li>
		<li class="col04"></li>
		<li class="col05">商品价格</li>
		<li class="col06">操作</li>
	</ul>
	<c:forEach items="${goodsList}" var="goods">
		<ul class="cart_list_td clearfix">
			<li class="col01"></li>
			<li class="col02"><img src="${pagePath}${goods.picture}"></li>
			<li class="col03">${goods.name}</li>
			<li class="col04"></li>
			<li class="col05"></li>
			<li class="col06"></li>
			<li class="col07">${goods.price}元</li>
			<li class="col08"><a href="${pagePath}/cart_delete.do?goods_id=${goods.id}">删除</a></li>
		</ul>
	</c:forEach>
	<c:if test="${empty goodsList}">
		<ul class="cart_list_td clearfix">
			<li class="col01"></li>
			<li class="col02"></li>
			<li class="col03"></li>
			<li class="col04"></li>
			<li class="col05">购物车为空！</li>
			<li class="col06"></li>
			<li class="col07"></li>
			<li class="col08"></li>
		</ul>
	</c:if>
	<ul class="settlements">
		<li class="col01"></li>
		<li class="col02">&nbsp;</li>
		<li class="col03">合计(不含运费)：<span>¥</span><em>${totalPrice}</em><br>共计<b>${totalCount}</b>件商品
		</li>
		<li class="col04"><c:if test="${empty user.name || empty user.mobile || empty user.address}">
				<a href="javascript:alert('请先补全收货地址再下单');">确定下单</a>
			</c:if> <c:if test="${!empty user.name && !empty user.mobile && !empty user.address}">
				<a href="${pagePath}/order_add.do?type=1">确定下单</a>
			</c:if></li>
	</ul>
	<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>